package com.superme.common.exceptions;

import com.superme.common.enums.ExceptionCodeEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 描述: TODO
 * 作者: yanruizhi
 * 时间: 2023/8/7 11:33
 */
@Getter
@Setter
public class FileException extends RuntimeException {
    private Integer code;
    private String msg;

    public FileException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public FileException(String msg) {
        this.code = ExceptionCodeEnum.AUTHENTICATION_FAILED.getCode();
        this.msg = msg;
    }
    public FileException(ExceptionCodeEnum codeEnum) {
        this.code = codeEnum.getCode();
        this.msg = codeEnum.getMessage();
    }

    public FileException() {
        this.code = ExceptionCodeEnum.FILE_EXCEPTION.getCode();
        this.msg = ExceptionCodeEnum.FILE_EXCEPTION.getMessage();
    }

}
